﻿using System.Collections.Generic;
using System.Linq;

namespace SopCastRecorder
{
	public class Option
	{
		public static int DefaultWait = 30;
		public static string DefaultFileNameFormat = "yyyyMMddHHmmss";
		public static string DefaultExtention = ".asf";
		public static string DefaultSopCastPath = @"C:\Program Files\SopCast\SopCast.exe";
		public static string DefaultNgCaptionRegex = "^SopCast - ログイン$";
		public static string DefaultBodyCaptionRegex = "^SopCast - .*";
		public static string DefaultDialogCaptionRegex = "^名前を付けて保存$";
		public static int DefaultSopCastBodyAddressTextIndex = 0;
		public static int DefaultSopCastPlayerRecordButtonIndex = 2;
		public static int DefaultSopCastSaveDialogInputTextIndex = 0;

		public List<ScheduleInfo> ScheduleInfoes { get; set; }
		public List<Channel> Channels { get; set; }
		public int Wait { get; set; }
		public string FileNameFormat { get; set; }
		public string Extention { get; set; }
		public string SopCastPath { get; set; }
		public string NgCaptionRegex { get; set; }
		public string BodyCaptionRegex { get; set; }
		public string DialogCaptionRegex { get; set; }
		public int SopCastBodyAddressTextIndex { get; set; }
		public int SopCastPlayerRecordButtonIndex { get; set; }
		public int SopCastSaveDialogInputTextIndex { get; set; }
		public Option()
		{
			this.ScheduleInfoes = new List<ScheduleInfo>();
			this.Wait = DefaultWait;
			this.FileNameFormat = DefaultFileNameFormat;
			this.Extention = DefaultExtention;
			this.SopCastPath = DefaultSopCastPath;
			this.NgCaptionRegex = DefaultNgCaptionRegex;
			this.BodyCaptionRegex = DefaultBodyCaptionRegex;
			this.DialogCaptionRegex = DefaultDialogCaptionRegex;
			this.SopCastBodyAddressTextIndex = DefaultSopCastBodyAddressTextIndex;
			this.SopCastPlayerRecordButtonIndex = DefaultSopCastPlayerRecordButtonIndex;
			this.SopCastSaveDialogInputTextIndex = DefaultSopCastSaveDialogInputTextIndex;
		}
		public Channel[] GetChannels()
		{
			if (this.Channels == null || this.Channels.Count() == 0)
			{
				this.Channels = new List<Channel>();
				this.Channels.Add(new Channel() { Name = "NHK 総合", Address = "sop://broker.sinohao.com:3920/5378" });
				this.Channels.Add(new Channel() { Name = "NHK Eテレ", Address = "sop://broker.sinohao.com:3920/5375" });
				this.Channels.Add(new Channel() { Name = "日本テレビ", Address = "sop://broker.sinohao.com:3920/5376" });
				this.Channels.Add(new Channel() { Name = "テレビ朝日", Address = "sop://broker.sinohao.com:3920/5373" });
				this.Channels.Add(new Channel() { Name = "TBSテレビ", Address = "sop://broker.sinohao.com:3920/5377" });
				this.Channels.Add(new Channel() { Name = "テレビ東京", Address = "sop://broker.sinohao.com:3920/5372" });
				this.Channels.Add(new Channel() { Name = "フジテレビ", Address = "sop://broker.sinohao.com:3920/5374" });
				this.Channels.Add(new Channel() { Name = "読売テレビ", Address = "sop://broker.sinohao.com:3920/4422" });
				this.Channels.Add(new Channel() { Name = "朝日放送(ABC)", Address = "sop://broker.sinohao.com:3920/4420" });
				this.Channels.Add(new Channel() { Name = "毎日放送", Address = "sop://broker.sinohao.com:3920/4421" });
				this.Channels.Add(new Channel() { Name = "関西テレビ", Address = "sop://broker.sinohao.com:3920/2279" });
				this.Channels.Add(new Channel() { Name = "テレビ大阪", Address = "sop://broker.sinohao.com:3920/5118" });
				this.Channels.Add(new Channel() { Name = "サンテレビ", Address = "sop://broker.sinohao.com:3920/5117" });
				this.Channels.Add(new Channel() { Name = "NHK BS1", Address = "sop://broker.sinohao.com:3920/5364" });
				this.Channels.Add(new Channel() { Name = "NHK BSプレミアム HD", Address = "sop://broker.sinohao.com:3920/5346" });
				this.Channels.Add(new Channel() { Name = "NHK BSプレミアム", Address = "sop://broker.sinohao.com:3920/584 " });
				this.Channels.Add(new Channel() { Name = "BS 日テレ", Address = "sop://broker.sinohao.com:3920/557 " });
				this.Channels.Add(new Channel() { Name = "BS 朝日", Address = "sop://broker.sinohao.com:3920/583 " });
				this.Channels.Add(new Channel() { Name = "BS TBS", Address = "sop://broker.sinohao.com:3920/5119" });
				this.Channels.Add(new Channel() { Name = "BSジャパン", Address = "sop://broker.sinohao.com:3920/5120" });
				this.Channels.Add(new Channel() { Name = "BS フジ", Address = "sop://broker.sinohao.com:3920/548 " });
				this.Channels.Add(new Channel() { Name = "WOWOWプライム HD", Address = "sop://broker.sinohao.com:3920/5365" });
				this.Channels.Add(new Channel() { Name = "WOWOWプライム", Address = "sop://broker.sinohao.com:3920/553 " });
				this.Channels.Add(new Channel() { Name = "J SPORTS 4 HD", Address = "sop://broker.sinohao.com:3920/5369" });
				this.Channels.Add(new Channel() { Name = "J SPORTS 4", Address = "sop://broker.sinohao.com:3920/556 " });
				this.Channels.Add(new Channel() { Name = "ゴルフネットワーク HD", Address = "sop://broker.sinohao.com:3920/5370" });
				this.Channels.Add(new Channel() { Name = "ゴルフネットワーク", Address = "sop://broker.sinohao.com:3920/1698" });
				this.Channels.Add(new Channel() { Name = "ムービープラス HD", Address = "sop://broker.sinohao.com:3920/5366" });
				this.Channels.Add(new Channel() { Name = "ムービープラス", Address = "sop://broker.sinohao.com:3920/554 " });
				this.Channels.Add(new Channel() { Name = "キッズステーション HD", Address = "sop://broker.sinohao.com:3920/5371" });
				this.Channels.Add(new Channel() { Name = "キッズステーション", Address = "sop://broker.sinohao.com:3920/1699" });
			}
			return this.Channels.ToArray();
		}
	}
}
